package NodeInfo;

import java.util.ArrayList;
import java.util.Stack;

/**
 * All node information
 * @author roccia
 *
 */
public class NodeInfo 
{

	private int antennagain = 2;
	private double PTx_mw;
	private double PRx_mw;
	private double MaxTxRange;
	private double radius;
	private double FadeMargin=5;
	private double wavelen;
	private double _currTx = 9;			//dBm
	private double _altitude = 16; 		//m
	private double _txCblLoss = 0.9;	//dB
	private double _TxFreq = 2.44; 		//GHz
	private double _rxSens = -85;		//dB
	private double _rxClbLoss = 1.0;	//dB
	private float _speed = 5.0f;		//m/s
	private float _xpos;
	private float _ypos;
	private float _zpos;
	private int NodeId;
	private int amISlave;
	private Stack<Integer> historic;
	private Stack<Integer> futureMoves;
	private Stack<Integer> moves;
	private ArrayList<String> receivedMsgs;
	private int level=1;	
	private int axis=0;
	private int countRdm=20;
	private boolean CanIChangeStatus=true;
	private int countSteps=0;
	
	/**
	 *  Calculation part, movement is based on the MaxTxRange. 
	 *  wavelen, PTx_mw and PRx_mw just for making the equation looks simple
	 */
	
	public NodeInfo()
	{
		    historic=new Stack<Integer>();
		    amISlave=NodeId;
		    futureMoves=new Stack<Integer>();
		    receivedMsgs=new ArrayList<String>();
		    this.wavelen = (3.0*Math.pow(10, 8)/(_TxFreq*Math.pow(10, 9)));
		    
		    PTx_mw =Math.pow(10,(_currTx/10));
		    PRx_mw = Math.pow(10,(_rxSens+_rxClbLoss+FadeMargin-antennagain)/10); 
		    MaxTxRange = (this.wavelen/4*Math.PI)*Math.sqrt(this.PTx_mw/this.PRx_mw);
		    radius = MaxTxRange/2; 
	}
	
	public double getTx() {
		return _currTx;
	}
	public void setTx(double _currTx) {
		this._currTx = _currTx;
	}
	
	public double getAltitude() {
		return _altitude;
	}
	public void setAltitude(double _altitude) {
		this._altitude = _altitude;
	}

	public double getTxCblLoss() {
		return _txCblLoss;
	}
	public void setTxCblLoss(double _txCblLoss) {
		this._txCblLoss = _txCblLoss;
	}

	public double getTxFreq() {
		return _TxFreq;
	}
	public void setTxFreq(double _TxFreq) {
		this._TxFreq = _TxFreq;
	}

	public double getRxSens() {
		return _rxSens;
	}
	public void setRxSens(double _rxSens) {
		this._rxSens = _rxSens;
	}

	public double getRxClbLoss() {
		return _rxClbLoss;
	}
	public void setRxClbLoss(double _rxClbLoss) {
		this._rxClbLoss = _rxClbLoss;
	}

	public double getSpeed() {
		return _speed;
	}
	public void setSpeed(float _speed) {
		this._speed = _speed;
	}

	public float getXpos() {
		return _xpos;
	}
	public void setXpos(float xpos) {
		this._xpos = xpos;
	}

	public float getYpos() {
		return _ypos;
	}
	public void setYpos(float ypos) {
		this._ypos = ypos;
	}
	
	public void setZpos(float zpos)
	{
		this._zpos = zpos;
	}

	public float getZpos() {
		return _zpos;
	}
   
	public void setNodeId(int nodeid)
	{
		this.NodeId=nodeid;
	}
	
	public int getNodeId(){
		return this.NodeId;
	}
	
	public double getRadius(){
		return this.radius;
	}
	
	public double getMaxTxRange(){
		return this.MaxTxRange;
	}

	public Stack<Integer> getHistoric() {
		return historic;
	}

	public void setHistoric(Stack<Integer> historic) {
		this.historic = historic;
	}

	public ArrayList<String> getReceivedMsgs() {
		return receivedMsgs;
	}

	public void setReceivedMsgs(ArrayList<String> receivedMsgs) {
		this.receivedMsgs = receivedMsgs;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public Stack<Integer> getFutureMoves() {
		return futureMoves;
	}

	public void setFutureMoves(Stack<Integer> futureMoves) {
		this.futureMoves = futureMoves;
	}

	public int getAxis() {
		return axis;
	}

	public void setAxis(int axis) {
		this.axis = axis;
	}

	public int getCountRdm() {
		return countRdm;
	}

	public void setCountRdm(int countRdm) {
		this.countRdm = countRdm;
	}

	public boolean isCanIChangeStatus() {
		return CanIChangeStatus;
	}

	public void setCanIChangeStatus(boolean canIChangeStatus) {
		CanIChangeStatus = canIChangeStatus;
	}

	public int getAmISlave() {
		return amISlave;
	}

	public void setAmISlave(int amISlave) {
		this.amISlave = amISlave;
	}

	public int getCountSteps() {
		return countSteps;
	}

	public void setCountSteps(int countSteps) {
		this.countSteps = countSteps;
	}

	public Stack<Integer> getMoves() {
		return moves;
	}

	public void setMoves(Stack<Integer> moves) {
		this.moves = moves;
	}
	
}
